package com.serge.smartdacha;

import android.app.Activity;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.webkit.WebView;

public class GraphActivity extends Activity {

    public static final String GRAPH_URL = "graph_url";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.graph);
        openUrl();
    }

    private void openUrl() {
        String graphUrl = getIntent().getExtras().getString(GRAPH_URL);

        WebView webView = (WebView) findViewById(R.id.webView);
        webView.clearCache(true);
        webView.loadUrl(graphUrl);
        webView.setNetworkAvailable(true);

    }

    @Override
    protected void onResume() {
        super.onResume();
        openUrl();
    }
}
